package Test6;
//平行四边形
public class Rhomboid extends Figure{
    private double base;
    private double border;
    private double h;

    public Rhomboid() {
    }
    public Rhomboid(double base, double border, double h) {
        this.base = base;
        this.border = border;
        this.h = h;
    }

    public double getBase() {
        return base;
    }
    public void setBase(double base) {
        this.base = base;
    }
    public double getBorder() {
        return border;
    }
    public void setBorder(double border) {
        this.border = border;
    }
    public double getH() {
        return h;
    }
    public void setH(double h) {
        this.h = h;
    }

    @Override
    public void perimeter() {
        System.out.println("平行四边形周长为:"+(this.getBase()+this.getBorder())*2);
    }

    @Override
    public void area() {
        System.out.println("平行四边形面积为:"+(this.getH()*this.getBase())/2);
    }
}
